﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SeleniumToolkit;
using NUnit.Framework;

namespace NUnit.CustomSeleniumFactory
{
    [WebFixture]
    public class Example
    {
        [WebTest]
        public void ShowRetrievingOurCustomSeleniumInstance()
        {
            CustomSelenium browser = Browser.Current as CustomSelenium;
            Assert.IsNotNull(browser);
        }

        [WebTest]
        public void ShowDoCommandUsage()
        {
            CustomSelenium browser = Browser.Current as CustomSelenium;
            string[] inputParams = { "Hello World" };
            string result = browser.CommandProcessor.DoCommand("getMyValue", inputParams);

            Assert.IsNotNull(result);
            Assert.AreEqual("OK,Hello World", result);
        }

        [WebTest]
        public void ShowGetStringUsage()
        {
            CustomSelenium browser = (CustomSelenium)Browser.Current;
            string result = browser.CommandProcessor.GetString("getMyValue", new string[] { "Hello World" });

            Assert.AreEqual("Hello World", result);
        }

    }
}
